<template>
<!--    <el-form :rules="rules" :model="ruleForm">-->
<!--        <el-form-item label="name" prop="name">-->
<!--            <el-input v-model="ruleForm.name"/>-->
<!--        </el-form-item>-->
<!--    </el-form>-->

    <el-menu
        active-text-color="#ffd04b"
        background-color="#545c64"
        class="el-menu-vertical-demo"
        default-active="2"
        text-color="#fff"
    >
<!--        @open="handleOpen"-->
<!--        @close="handleClose"-->
        <template v-for="(item,index) in menuOptions">
            <menu-item :item="item" :index="index"></menu-item>
        </template>
    </el-menu>
<!--    <el-tree-v2 :data="data" :props="props" show-checkbox :height="208" ref="tree" :indent="30"/>-->
    <el-button @click="t1">测试</el-button>
<!--    <el-button @click="t1">登录才可访问</el-button>-->
<!--    <el-button @click="t2">拥有权限才可访问</el-button>-->
</template>

<script>

import {loginAfter} from "../network/login/test";
import MenuItem from "../components/MenuItem.vue";

export default {
    name: "Test",
    components: {MenuItem},
    data() {
        return{
            menuOptions:[
                {
                    path: '/aaa',
                    name: 'a',
                    children: [
                        {
                            path: '/aaa1',
                            name: 'a1',
                            children: []
                        },
                        {
                            path: '/aaa2',
                            name: 'a2',
                            children: [
                                {
                                    path: '/aaaa1',
                                    name: 'a11',
                                }
                            ]
                        }
                    ]
                },
                {
                    path: '/bbb',
                    name: 'b',
                    children: [

                    ]
                },
                {
                    path: '/ccc',
                    name: 'c',
                    children: []
                },
            ],
            data:[
                {
                    id: 1,
                    label: '1',
                    children: [
                        {
                            id: 11,
                            label: '11',
                        },
                        {
                            id: 12,
                            label: '12',
                        },
                        {
                            id: 13,
                            label: '13',
                        },
                    ]
                }
            ],
            props:{
                value: 'id',
                label: 'label',
                children: 'children',
            },
            value: '',
            ruleForm:{
                name: 'Hello',
            },
            rules:{
                name: [
                    { required: true, message: 'Please input Activity name', trigger: 'blur' },
                    { min: 3, max: 5, message: 'Length should be 3 to 5', trigger: 'blur' },
                ],
            },
        }
    },
    methods: {
        t1(){
            console.log('this.$refs.tree.getCurrentKeys()',this.$refs.tree.getCheckedKeys());
            console.log('this.$refs.tree.getHalfCheckedNodes()',this.$refs.tree.getHalfCheckedNodes());
            console.log('this.$refs.tree.getHalfCheckedKeys()',this.$refs.tree.getHalfCheckedKeys());
            // loginAfter().then(vo=>{
            //     console.log('登录可获得的资源',vo)
            // })
            // console.log('初始路由：this.$router.options.routes',this.$router.options.routes);
            // console.log('动态加载后的路由：this.$router.getRoutes()',this.$router.getRoutes());
            // getA().then(data=>{
            //     console.log('data',data)
            // })
            // console.log('查看路由：',this.$router)
            // console.log('查看路由选项：',this.$router.options)
            // console.log('登录用户',this.$store.state.loginUser);
        },
        t2(){

        }
    }
}
</script>

<style scoped>

</style>
